package org.example.demo01.controller;

import org.example.demo01.pojo.Receipt;
import org.example.demo01.service.ReceiptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class ReceiptController {
    @Autowired
    private ReceiptService receiptService;
    //新增顾客
    @RequestMapping(value = "/add", produces = "text/html;charset=utf-8") //设置当前方法的请求访问路径
    @ResponseBody //将返回值作为响应体返回
    public void add(Receipt receipt) {
        receiptService.addRecept(receipt);
    }
}
